package com.cheerful.blog.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author: Wang Zhifu
 * @create: 2022/2/10 21:24
 * @Description:
 */
@Configuration
@EnableTransactionManagement
@MapperScan("com.cheerful.blog.dao")
public class MybatisConfig {

    /**
     * 分页插件
     * @return 超过最大页码返回首页，每页最多1000条
     */
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor().setOverflow(true).setLimit(1000);
    }


}